home *** CD-ROM | disk | FTP | other *** search
/ DarkBASIC - The Ultimate 3D Game Creator / PCactive 8 CD1 - DarkBasic.iso / SOFTWARE / DEMOS / DarkForge2000 / snippets_vol3 / snip_verticalmayhem.dba < prev    next >
Encoding:
Text File  |  2000-09-30  |  1.4 KB  |  102 lines

  1. `    -------------------------------------------------------------------------
  2. `    Vertical Mayhem                               DarkForge Snippet 27/9/2000
  3. `    -------------------------------------------------------------------------
  4. `    A subtle but effective plain trick with a bitmap.
  5. `    Turn on/off ghosting or rotation for other styles.
  6.  
  7. sync rate 0
  8. sync on
  9. hide mouse
  10.  
  11. load bitmap "sanctuary_by_thomas.bmp",1
  12.  
  13. bw=bitmap width(1)
  14. jump=480/12
  15.  
  16. `    split into 12 chunks
  17.  
  18. offsety=0
  19.  
  20. for a=1 to 12
  21.  
  22.     get image a,0,offsety,bw,offsety+jump
  23.     inc offsety,jump
  24.  
  25. next a
  26.  
  27. set current bitmap 0
  28.  
  29. autocam off
  30.  
  31. make object plain 1,80,5
  32. make mesh from object 1,1
  33. delete object 1
  34.  
  35. make object plain 2,1,1
  36. color object 2,rgb(0,0,0)
  37.  
  38. dim y(12)
  39.  
  40. for a=1 to 12
  41.  
  42.     add limb 2,a,1
  43.     texture limb 2,a,13-a
  44.     offset limb 2,a,0,y,0
  45.     y(a)=y
  46.     inc y,5
  47.  
  48. next a
  49.  
  50. color backdrop rgb(0,0,0)
  51. set ambient light 100
  52.  
  53. ghost object on 2
  54.  
  55. position camera 0,27.5,-50
  56. rotate camera 0,0,0
  57.  
  58. x1#=-100
  59. x2#=100
  60.  
  61. repeat
  62.  
  63.     for a=1 to 12 step 2
  64.  
  65.         offset limb 2,a,x1#,y(a),0
  66.  
  67.     next a
  68.  
  69.     for a=2 to 12 step 2
  70.  
  71.         offset limb 2,a,x2#,y(a),0
  72.  
  73.     next a
  74.  
  75.     inc x1# : dec x2#
  76.  
  77.     sync
  78.  
  79. until x2#=-1
  80.  
  81. sync
  82.  
  83. rx=0 : p=0
  84.  
  85. do
  86.  
  87.     for a=1 to 12
  88.         rotate limb 2,a,wrapvalue(rx),0,0
  89.     next a
  90.  
  91.     lx1=limb angle x(2,1)
  92.     lx2=limb angle x(2,12)
  93.  
  94.     yrotate object 2,wrapvalue(rx)
  95.  
  96.     inc rx,2
  97.  
  98.     sync
  99.  
  100. loop
  101.  
  102.